home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- yit = Math.floor(Math.random() * 371) + 30;
- if(this._x < -500)
- {
- this._x = 900;
- this._y = _root.depth._y - yit;
- die = 1;
- this.gotoAndStop(1);
- }
- if(this._x > 1000)
- {
- this._x = -400;
- this._y = _root.depth._y - yit;
- die = 1;
- this.gotoAndStop(1);
- }
- this._x += _global.xgo;
- this._y += _global.ygo;
- if(die == 1)
- {
- myRadians = Math.atan2(this._y - _root.player._y,this._x - _root.player._x);
- xleg = this._x - _root.player._x;
- yleg = this._y - _root.player._y;
- scared = Math.sqrt(xleg * xleg + yleg * yleg);
- if(scared < 50)
- {
- this._y -= 1;
- }
- this._x -= 4;
- }
- if(_root.player.eat.hitTest(this.eat))
- {
- die = 0;
- this.gotoAndPlay("die");
- scoreity = 200;
- _root.tools.instascore.text = "+" + scoreity;
- _root.tools.instblock._alpha = 0;
- _global.scoreit = _global.scoreit * 1 + scoreity;
- _global.boost += scoreity / 30;
- _root.tools.bar1.gotoAndStop(_global.boost + 1);
- }
- }
-